﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Net;
using System.Linq;
using BookDownloader.Core.Behaviour;
using BookDownloader.Core.Data;
using BookDownloader.Core.Implementation.BaseLibEngine;
using BookDownloader.Core.Implementation.BaseLibEngine.Parser;
using BookDownloader.Core.Implementation.LibRusEc.Parser;
using Microsoft.Practices.Unity;

namespace BookDownloader.Core.Implementation.LibRusEc
{
	[Serializable]
	public class LibRusEcLibraryProvider : LibraryProviderBase
	{
		public LibRusEcLibraryProvider(List<LibraryBook> library) : base(library)
		{
		}

		protected override void LoadData()
		{
			ISqlStreamProvider provider = DiFacade.Container.Resolve<ISqlStreamProvider>();
			AuthorBooksParser abp = new AuthorBooksParser(provider);
			abp.LoadList(LibFileTypes.AuthorBook, authorBooks);

			AuthorsParser ap = new AuthorsParser(provider);
			ap.LoadList(LibFileTypes.Author, authors);

			BooksParser bp = new BooksParser(provider);
			bp.LoadList(LibFileTypes.Book, books);
		}
	}
}
